import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "@/views/Login.vue"
import Home from "@/views/Home.vue"
import Cat from '@/components/cat/Cat.vue'
import System from '@/components/system/System.vue'
import Hotel from '@/components/hotel/Hotel.vue'
import Picture from '@/components/picture/Picture.vue'
import Order from '@/components/order/Order.vue'
import Opinion from '@/components/opinion/Opinion.vue'
Vue.use(VueRouter)

const routes = [
    {
      path:'',
      redirect:'/login'
    },
    {
      path:'/login',
      component:Login
    },
    {
      path:'/home',
      component:Home,
       children: [
           { path: '/', redirect: '/cat' },
           { path: '/cat', component: Cat },
           { path: '/system', component: System },
           { path: '/hotel', component: Hotel },
           { path: '/picture', component: Picture },
           { path: '/order', component: Order },
           { path: '/opinion', component: Opinion }
      ]
    }
]

const router = new VueRouter({
  routes,
  mode:'history'
})

export default router
